//
//  XMGVerticalButton.m
//  01-百思不得姐
//
//  Created by xiaomage on 15/7/26.
//  Copyright (c) 2015年 小码哥. All rights reserved.
//

#import "XMGVerticalButton.h"

@implementation XMGVerticalButton

- (void)setup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)awakeFromNib
{
    [self setup];
}


- (void)layoutSubviews
{
    [super layoutSubviews];
//    self.backgroundColor = [UIColor blackColor];
    // 调整图片
    self.imageView.x = self.width / 3;
    self.imageView.y = 0;
    self.imageView.width = self.width / 3;
    self.imageView.height = 120 * px;
    self.imageView.layer.cornerRadius = 15;
    
   
    
    // 调整文字
    self.titleLabel.x = 0;
    self.titleLabel.y = self.imageView.height - 50 * px;
    self.titleLabel.width = self.width;
    self.titleLabel.height = self.height - self.titleLabel.y;
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.font = [UIFont systemFontOfSize:SmallFont];
}

@end
